/**
 * @Project Name: ${projectName}
 * @Package Name: ${projectPackageName}.business.fallback.${domainName}
 * @Since JDK 1.8
 */
package ${projectPackageName}.business.fallback.${domainName};

import ${projectPackageName}.business.client.${domainName}.${className}FeignClient;
import ${projectPackageName}.business.domain.dto.${domainName}.${className}DTO;
import ${projectPackageName}.commons.tools.page.ConditionAndPagination;
import ${projectPackageName}.commons.tools.page.PageData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: ${className}BusinessService
 * @Author 胡松 hoofungson@163.com
 * @Date ${datetime}
 * @Version V1.0
 */
@Slf4j
@Service
public class ${className}FeignClientFallbackFactory implements FallbackFactory<${className}FeignClient> {

    @Override
    public ${className}FeignClient create(Throwable throwable) {
        log.error("", throwable);
        return new ${className}FeignClient() {
            /**
             * 保存或更新
             *
             * @param ${lowerCaseClassName}DTO
             * @return
             **/
            @Override
            public Boolean saveOrUpdate(${className}DTO ${lowerCaseClassName}DTO) {
                log.info("进入熔断器，服务降级！！");
                return null;
            }

            /**
             * 批量保存或更新
             *
             * @param ${lowerCaseClassName}DTOList
             * @return
             **/
            @Override
            public Boolean batchSaveOrUpdate(List<${className}DTO> ${lowerCaseClassName}DTOList) {
                log.info("进入熔断器，服务降级！！");
                return null;
            }

            /**
             * 根据ID获取
             *
             * @param id
             * @return
             **/
            @Override
            public ${className}DTO getById(Long id) {
                log.info("进入熔断器，服务降级！！");
                return null;
            }

            /**
             * 根据条件获取
             *
             * @param condition
             * @return
             **/
            @Override
            public ${className}DTO getByCondition(${className}DTO condition) {
                log.info("进入熔断器，服务降级！！");
                return null;
            }

            /**
             * 获取所有列表
             *
             * @return
             **/
            @Override
            public List<${className}DTO> listAll() {
                log.info("进入熔断器，服务降级！！");
                return null;
            }

            /**
             * 根据条件获取列表
             *
             * @param condition
             * @return
             **/
            @Override
            public List<${className}DTO> findByCondition(${className}DTO condition) {
                log.info("进入熔断器，服务降级！！");
                return null;
            }

            /**
             * 获取分页
             *
             * @param conditionAndPagination
             * @return
             **/
            @Override
            public PageData<${className}DTO> page(ConditionAndPagination<${className}DTO> conditionAndPagination) {
                log.info("进入熔断器，服务降级！！");
                return null;
            }

            /**
             * 根据ID删除
             *
             * @param id
             * @return
             **/
            @Override
            public Boolean deleteById(Long id) {
                log.info("进入熔断器，服务降级！！");
                return null;
            }

            /**
             * 根据条件删除
             *
             * @param condition
             * @return
             **/
            @Override
            public Boolean deleteByCondition(${className}DTO condition) {
                log.info("进入熔断器，服务降级！！");
                return null;
            }
        };
    }
}